home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 8
/
Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO
/
047a
/
probots.arj
/
ABASIRI.PR
next >
Wrap
Text File
|
1988-11-05
|
2KB
|
73 lines
PROCEDURE Abasiri;
{
Based on C-Robot by Hortense Endoh
}
VAR dir, deg, Range, spd : Integer;
PROCEDURE shoot;
BEGIN
IF speed = 0 THEN {i.e., stopped -- probably ran into something}
BEGIN
dir := dir+90+Random(180); {go at random in opposite direction}
spd := 100;
END;
drive(dir, spd);
Range := scan(deg, 10);
IF (Range > 40) THEN cannon(deg, Range)
ELSE BEGIN
deg := deg+20;
Range := scan(deg, 10);
IF Range = 0 THEN
BEGIN
deg := deg-40;
Range := scan(deg, 10);
IF Range = 0 THEN
BEGIN
deg := deg+60;
Range := scan(deg, 10);
WHILE Range = 0 DO
BEGIN
deg := deg+20;
Range := scan(deg, 10);
END;
END;
END;
IF (Range > 40) THEN cannon(deg, Range);
END;
END;
PROCEDURE init_proc;
BEGIN
dir := 270; spd := 100; WHILE (loc_y > 200) DO shoot;
dir := 90; shoot; shoot; shoot;
dir := 180; WHILE (loc_x > 600) DO shoot;
spd := 50; dir := 0; WHILE (loc_x < 750) DO shoot;
deg := 90;
END;
BEGIN {Main Abasiri}
init_proc;
REPEAT
spd := 100; dir := 45; WHILE (loc_x < 800) DO shoot; dir := 225; shoot;
spd := 100; dir := 135; WHILE (loc_x > 750) DO shoot; dir := 315; shoot;
spd := 100; dir := 45; WHILE (loc_x < 800) DO shoot; dir := 225; shoot;
spd := 100; dir := 135; WHILE (loc_y < 800) DO shoot; dir := 315; shoot;
spd := 100; dir := 225; WHILE (loc_y > 750) DO shoot; dir := 45; shoot;
spd := 100; dir := 135; WHILE (loc_y < 800) DO shoot; dir := 315; shoot;
spd := 100; dir := 225; WHILE (loc_x > 200) DO shoot; dir := 45; shoot;
spd := 100; dir := 315; WHILE (loc_x < 250) DO shoot; dir := 135; shoot;
spd := 100; dir := 225; WHILE (loc_x > 200) DO shoot; dir := 45; shoot;
spd := 100; dir := 315; WHILE (loc_y > 200) DO shoot; dir := 135; shoot;
spd := 100; dir := 45; WHILE (loc_y < 250) DO shoot; dir := 225; shoot;
spd := 100; dir := 315; WHILE (loc_y > 200) DO shoot; dir := 135; shoot;
UNTIL Dead OR Winner;
END; { end of ABASIRI main }